/*
 * Created on Oct 21, 2003
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.vectrics.recruiter.struts;

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.vectrics.struts.Request;


public class JobForm extends JobFormBase {

	private static final long serialVersionUID = 6384049172553536861L;

	private transient static Logger log = Logger.getLogger(JobForm.class);	

	
	public ActionErrors doValidate(ActionMapping mapping, Request request) {
		log.debug("validate() called");
		request.setAttribute("companyId", this.getCompanyId());
		ActionErrors errors = new ActionErrors();
		if ((getTitle() == null) || (getTitle().trim().length() <= 0)) {
			log.debug("execute() - error found - job title not given");
			errors.add("Title", new ActionMessage("error.job.title.required"));
		}		
		
		return(errors);	
	}
	
	
}
